# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics do
  @moduledoc """
  Model evaluation metrics for classification problems. It can be used for image and video classification. Next tag: 9.

  ## Attributes

  *   `auPrc` (*type:* `number()`, *default:* `nil`) - The Area under precision recall curve metric.
  *   `auRoc` (*type:* `number()`, *default:* `nil`) - The Area Under Receiver Operating Characteristic curve metric. Micro-averaged for the overall evaluation.
  *   `baseAuPrc` (*type:* `number()`, *default:* `nil`) - The Area under precision recall curve metric based on priors.
  *   `confidenceMetricsEntries` (*type:* `list(GoogleApi.Language.V1.Model.XPSConfidenceMetricsEntry.t)`, *default:* `nil`) - Metrics that have confidence thresholds. Precision-recall curve can be derived from it.
  *   `confusionMatrix` (*type:* `GoogleApi.Language.V1.Model.XPSConfusionMatrix.t`, *default:* `nil`) - Confusion matrix of the evaluation. Only set for MULTICLASS classification problems where number of annotation specs is no more than 10. Only set for model level evaluation, not for evaluation per label.
  *   `evaluatedExamplesCount` (*type:* `integer()`, *default:* `nil`) - The number of examples used for model evaluation.
  *   `logLoss` (*type:* `number()`, *default:* `nil`) - The Log Loss metric.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :auPrc => number() | nil,
          :auRoc => number() | nil,
          :baseAuPrc => number() | nil,
          :confidenceMetricsEntries =>
            list(GoogleApi.Language.V1.Model.XPSConfidenceMetricsEntry.t()) | nil,
          :confusionMatrix => GoogleApi.Language.V1.Model.XPSConfusionMatrix.t() | nil,
          :evaluatedExamplesCount => integer() | nil,
          :logLoss => number() | nil
        }

  field(:auPrc)
  field(:auRoc)
  field(:baseAuPrc)

  field(:confidenceMetricsEntries,
    as: GoogleApi.Language.V1.Model.XPSConfidenceMetricsEntry,
    type: :list
  )

  field(:confusionMatrix, as: GoogleApi.Language.V1.Model.XPSConfusionMatrix)
  field(:evaluatedExamplesCount)
  field(:logLoss)
end

defimpl Poison.Decoder, for: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics do
  def decode(value, options) do
    GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V1.Model.XPSClassificationEvaluationMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
